package com.sskj.finance.ui.activity;


import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.flyco.tablayout.SlidingTabLayout;
import com.sskj.common.adapter.MyFragmentPagerAdapter;
import com.sskj.common.base.App;
import com.sskj.finance.R;
import com.sskj.finance.R2;
import com.sskj.finance.presenter.FinanceRecordActivityPresenter;
import com.sskj.lib.Constans;
import com.sskj.lib.RConfig;
import com.sskj.lib.base.BaseActivity;

import java.util.ArrayList;

import butterknife.BindView;

@Route(path = RConfig.FINAN_FINANCE_RECORD)//理财记录
public class FinanceRecordActivity extends BaseActivity<FinanceRecordActivityPresenter> {
    @BindView(R2.id.slidingTabLayout)
    SlidingTabLayout slidingTabLayout;
    @BindView(R2.id.viewPager)
    ViewPager viewPager;
    @Autowired
    boolean isTrade;
    private String[] titles = new String[]{App.INSTANCE.getString(R.string.finan_mortgageRecordActivity2_j), App.INSTANCE.getString(R.string.finan_financeRecordActivity2_j), App.INSTANCE.getString(R.string.finan_financeRecordActivity3_j)};

    @Override
    protected int getLayoutId() {
        return R.layout.finan_activity_finance_record;
    }

    @Override
    public FinanceRecordActivityPresenter getPresenter() {
        return new FinanceRecordActivityPresenter();
    }

    @Override
    protected void initView() {
        setTitle(App.INSTANCE.getString(R.string.finan_financeRecordActivity4_j));
        ARouter.getInstance().inject(this);
        ArrayList<Fragment> fragments = new ArrayList<>();
        fragments.add((Fragment) ARouter.getInstance().build(RConfig.FINAN_FRAGMENT_FINANCE).navigation());
        fragments.add((Fragment) ARouter.getInstance().build(RConfig.FINAN_FRAGMENT_FINANCE).withString(Constans.STATUS, "1").navigation());
        fragments.add((Fragment) ARouter.getInstance().build(RConfig.FINAN_FRAGMENT_FINANCE).withString(Constans.STATUS, "2").navigation());
        viewPager.setAdapter(new MyFragmentPagerAdapter(getSupportFragmentManager(), fragments));
        slidingTabLayout.setViewPager(viewPager, titles);

    }
}
